package com.eflow.model.e;

import lombok.Getter;

/**
 * @author hui se
 * @description
 * @create 2021-03-25 17:58
 **/
public enum RelativeTypeEnum {

    /**
     * 发起人所在组织
     */
    INITIATOR(1,"发起人所在组织"),
    /**
     * 审批人所在组织
     */
    APPROVE(2,"'审批人所在组织'"),
    /**
     * 流程变量中的组织
     */
    VARIABLE(3,"'流程变量中的组织'");

    @Getter
    private int code;
    @Getter
    private String msg;
    RelativeTypeEnum(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    /**
     * 通过code获取Msg
     *
     * @param code
     * @return
     * @Description:
     */
    public static RelativeTypeEnum getEnumByCode(int code) {
        for (RelativeTypeEnum e : RelativeTypeEnum.values()) {
            if (e.code == code) {
                return e;
            }
        }
        return null;
    }

}
